package jdk观察者模式;

import java.util.Observable;
import java.util.Observer;

public class GuMing implements Observer{
    private String name;
    public GuMing(String name){
        this.name=name;
    }

 /*   public void setName(String name) {
        this.name = name;
    }
*/
    @Override
    public void update(Observable o, Object arg) {
     double price=(double) arg;
     System.out.println(name +"收到股票价格:"+price);
    }
}
